export default{
    state:{
        username:"",
        userId:0,
        img:"",
        type:"",
        token:"",
    },
    mutations:{
        removeUser(state){
            state.username="";
            state.userId="";
            state.password="";
            state.token=""
        },
        loginUser(state,data){
            console.log("loginUser",data)
            state.username=data.userName;
            state.userId=data.id;
            state.img=data.img;
            state.type=data.type
        },
        removeToken(state){
            state.token=""
        },
        setToken(state,token){
            console.log("设置token",token)
            state.token=token
        }
    }
}